import request from '../axios/http'

//获取二级分类
export const reclassify = params => {
    return request({
        url:'/api/reclassify',
        method:'get',
        params
    })
}

//获取分类 只有id和name
export const getCategory = params => {
    return request({
        url:'/api/getCategory',
        method:'get',
        params
    })
}

//获取分类列表
export const list = params => {
    return request({
        url:'/category/list',
        method:'get',
        params
    })
}

//新增一级分类
export const addParent = params => {
    return request({
        url:'/category/addParent',
        method:'post',
        data:params
    })
}

//新增二级分类
export const addChild = params => {
    return request({
        url:'/category/addChild',
        method:'post',
        data:params
    })
}

//编辑
export const edit = params => {
    return request({
        url:'/category/edit',
        method:'post',
        data:params
    })
}

//删除
export const del = params => {
    return request({
        url:'/category/delete',
        method:'post',
        data:params
    })
}
